﻿Namespace AdvanceWars.Data
    Public Module ConstModule

        ''' <summary>
        ''' 基础路径
        ''' </summary>
        Public Const baseDir As String = "F:\AWDS\AWBS\Resources\Data"

#Region "define"

        Private ELEMENT_UNIT_EMPTY = "0xFFFF"
        Private ELEMENT_UNIT_DELETE = "0xFFFE"
        Private ELEMENT_TERRAIN_BLANK = "0xFFFD"

        Private ELEMENT_TERRAIN_START As Integer = 0
        Private ELEMENT_TERRAIN_END As Integer = 299
        Private ELEMENT_BUILDING_START As Integer = 300
        Private ELEMENT_BUILDING_END As Integer = 499
        Private ELEMENT_UNIT_START As Integer = 500
        Private ELEMENT_UNIT_END As Integer = 899
        Private ELEMENT_EXTRA_START As Integer = 900
        Private ELEMENT_EXTRA_END As Integer = 1299

        Private ELEMENT_TERRAIN_COLUMNS As Integer = 30
        Private ELEMENT_BUILDING_COLUMNS As Integer = 10
        Private ELEMENT_UNIT_COLUMNS As Integer = 20
        Private ELEMENT_EXTRA_COLUMNS As Integer = 20

        Private ARMY_ORANGE_STAR As Integer = 0
        Private ARMY_BLUE_MOON As Integer = 1
        Private ARMY_GREEN_EARTH As Integer = 2
        Private ARMY_YELLOW_COMET As Integer = 3
        Private ARMY_BLACK_HOLE As Integer = 4
        Private ARMY_NEUTRAL As Integer = 5

        Function MAKE_TERRAIN(ByVal x As Integer, ByVal y As Integer) As Integer
            Return x + (y * ELEMENT_TERRAIN_COLUMNS) + ELEMENT_TERRAIN_START
        End Function

        Function MAKE_BUILDING(ByVal x As Integer, ByVal y As Integer) As Integer
            Return x + (y * ELEMENT_BUILDING_COLUMNS) + ELEMENT_BUILDING_START
        End Function

        Function MAKE_UNIT(ByVal x As Integer, ByVal y As Integer) As Integer
            Return x + (y * ELEMENT_UNIT_COLUMNS) + ELEMENT_UNIT_START
        End Function

        Function MAKE_EXTRA(ByVal x As Integer, ByVal y As Integer) As Integer
            Return x + (y * ELEMENT_EXTRA_COLUMNS) + ELEMENT_EXTRA_START
        End Function

#End Region

    End Module
End Namespace
